import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import '../utils/CheckSvipUtil.dart';

class search_page extends StatelessWidget {
  const search_page({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: MediaQuery.of(context).size.width,
      height: MediaQuery.of(context).size.height,
      decoration: const BoxDecoration(
          image: DecorationImage(
              opacity: 0.5,
              image: AssetImage('assets/images/image_2.jpg'),
              fit: BoxFit.cover)),
      child: _bannerlayout(context),
    );
  }

  Widget _bannerlayout(BuildContext context) {
    return Column(children: [
      TextButton(
        onPressed: () => {CheckSvipUtil.checkUserIsSvip(context, false)},
        child: const Text(
          '点击显示弹窗',
          style: TextStyle(color: Color.fromARGB(255, 0, 255, 1), fontSize: 20),
        ),
      ),
      RichText(
        text: TextSpan(
          children: [
            const TextSpan(
              text: '普通文字 ',
              style: TextStyle(color: Colors.black),
            ),
            TextSpan(
              text: '可点击文字',
              style: const TextStyle(color: Colors.red),
              recognizer: TapGestureRecognizer()
                ..onTap = () => print('特定文字被点击'),
            ),
          ],
        ),
      )
    ]);
  }

Widget getGridView(){
  return GridView.builder(
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 2, // 每行2个子项
            crossAxisSpacing: 4.0, // 交叉轴间距
            mainAxisSpacing: 4.0, // 主轴间距
          ),
          itemCount: 20, // 子项总数
          itemBuilder: (BuildContext context, int index) {
            return Container(
              decoration: BoxDecoration(
                border: Border.all(color: Colors.grey),
                image: DecorationImage(
                  image: NetworkImage('https://via.placeholder.com/150'), // 网络图片
                  fit: BoxFit.cover,
                ),
              ),
            );
          });
}

}
